package game.util;

import game.entity.Hero;
import game.serverenv.GameServerOnlineManager;
import lion.message.MyServerResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class NetTool {

	@Autowired
	private GameServerOnlineManager gameServerOnlineManager;

	public void sendMsg(int heroId, MyServerResponse msg) {
		Hero hero = gameServerOnlineManager.getByID(heroId);
		if (hero != null) {
			hero.sendMsg(msg);
		}
	}

}
